package com.GGG.cloud.house.web;

import com.GGG.cloud.house.domain.entity.Properties;
import com.GGG.cloud.house.domain.entity.PropertiesRentType;
import com.GGG.cloud.house.domain.vo.PropertiesAndRentTypeVO;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @Desc
 * @Author Administrator
 * @Date 2020/10/04 13:31
 * @Address
 * @Copyright
 * @Version
 */
@Controller
public class SinglePropertiesController {

    @RequestMapping("single-properties.html")
    public String singleProperties(ModelMap modelMap){
        modelMap.put("title","房产交易平台");
        modelMap.put("desc","房产单个显示格局");
        modelMap.put("info","Friuli-Venezia Giulia");


        Properties properties = new Properties();
        properties.setTitle("江南宅院");
        properties.setAddress("锦江区东大街下东大街568号");
        properties.setPrice(550F);
        properties.setPictureUrl("assets/images/property/property-1.jpg");
        properties.setDescription("房产交易平台ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et lore magna iqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut quipx ea codo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolo.\n" +
                "\n" +
                "房产交易平台is the Best should be the consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore lore gna iqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex eacm emod tempor nt ut labore lore magna iqua. Ut enim ad minim veniamco laboris nisi ut aliqu.\n" +
                "\n" +
                "房产交易平台is the Best should be the consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore lore gna iqua. Ut enim ad minim veniam, quis nostrud exercitation.");

        //面积
        properties.setSquare(550F);
        //车位
        properties.setGarageNumber(3);
        //卫生间数量
        properties.setBathroomNumber(3);
        //房间数量
        properties.setRoomNumber(6);
        //厨房数量
        properties.setKitchenNumber(2);
        //视频
        properties.setVideoUrl("");

        properties.setIsRealtyManagement((byte)1);
        properties.setIsElectric((byte)0);
        properties.setIsNaturalGas((byte)1);
        properties.setIsWater((byte)1);
        properties.setIsAirConditioning((byte)1);
        properties.setIsFurniture((byte)0);
        properties.setIsBalcony((byte)1);
        properties.setIsCabletv((byte)1);
        properties.setIsParking((byte)0);
        properties.setIsLift((byte)1);
        properties.setIsPool((byte)0);
        properties.setIsDishwater((byte)1);
        properties.setIsFerigerator((byte)0);
        properties.setIsKitchenUtensils((byte)1);

        PropertiesRentType rentType = new PropertiesRentType();
        rentType.setTypeName("出租");

        PropertiesAndRentTypeVO vo = new PropertiesAndRentTypeVO();
        vo.setProperties(properties);
        vo.setPropertiesRentType(rentType);

        modelMap.put("vo",vo);

//定义总的存放数据的集合
        List<PropertiesAndRentTypeVO> andRentTypeVOS1 = new ArrayList<>();

        Properties properties_1 = new Properties();
        //图片地址
        properties_1.setPictureUrl("assets/images/property/sidebar-property-1.jpg");
        //房产标题
        properties_1.setTitle("江南宅院");
        //地址
        properties_1.setAddress("锦江区东大街下东大街568号");
        //价格
        properties_1.setPrice(550F);
        PropertiesRentType rentType_1 = new PropertiesRentType();
        rentType_1.setTypeName("出租");

        PropertiesAndRentTypeVO vo_1 = new PropertiesAndRentTypeVO();
        vo_1.setProperties(properties_1);
        vo_1.setPropertiesRentType(rentType_1);

        andRentTypeVOS1.add(vo_1);


        Properties properties_2 = new Properties();
        //图片地址
        properties_2.setPictureUrl("assets/images/property/sidebar-property-1.jpg");
        //房产标题
        properties_2.setTitle("江南宅院");
        //地址
        properties_2.setAddress("锦江区东大街下东大街568号");
        //价格
        properties_2.setPrice(550F);
        PropertiesRentType rentType_2 = new PropertiesRentType();
        rentType_2.setTypeName("出租");

        PropertiesAndRentTypeVO vo_2 = new PropertiesAndRentTypeVO();
        vo_2.setProperties(properties_2);
        vo_2.setPropertiesRentType(rentType_2);

        andRentTypeVOS1.add(vo_2);


        Properties properties_3 = new Properties();
        //图片地址
        properties_3.setPictureUrl("assets/images/property/sidebar-property-1.jpg");
        //房产标题
        properties_3.setTitle("江南宅院");
        //地址
        properties_3.setAddress("锦江区东大街下东大街568号");
        //价格
        properties_3.setPrice(550F);
        PropertiesRentType rentType_3 = new PropertiesRentType();
        rentType_3.setTypeName("出售");

        PropertiesAndRentTypeVO vo_3 = new PropertiesAndRentTypeVO();
        vo_3.setProperties(properties_3);
        vo_3.setPropertiesRentType(rentType_3);

        andRentTypeVOS1.add(vo_3);

        modelMap.put("andRentTypeVOS1",andRentTypeVOS1);

        return "single-properties";
    }

}
